package Week6.J0521;

import java.util.Scanner;

public class 素数回文_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        StringBuffer sbr = new StringBuffer(s);

        for (int i = s.length() - 2; i >= 0; i--) {
            sbr.append(s.charAt(i));
        }

        long a = Long.parseLong(sbr.toString());
        if (isPrime(a)) System.out.println("prime");
        else System.out.println("noprime");
    }

    private static boolean isPrime(long a) {
        if (a < 2) return false;
        for (long i = 2; i < Math.sqrt(a); i++) {
            if (a % i == 0) return false;
        }
        return true;
    }
}
